<template>
	<view>
		<u-navbar leftIcon="" title="商品訂單" placeholder>
			<view class="flexright" slot="right">
				<image class="posdcimg" src="@/static/image/system/posdc.png" mode="" v-if="pos_show"
					@click="jumpurl('/pages/workbench/newpos')"></image>
			</view>
		</u-navbar>
		<u-sticky bgColor="#fff">
			<u-tabs lineColor="#FFB800" lineWidth="15" :activeStyle="{
			             color: '#000000',
			             fontWeight: 'bold',
			             transform: 'scale(1.05)'
			         }" :inactiveStyle="{
			             color: '#666666',
			             transform: 'scale(1)'
			         }" :list="list1" @change="tabChage"></u-tabs>
		</u-sticky>
		<view class="mainpadding2">
			<view class="margin_top flexbetween zhizuotop radius" v-show="tabsId==2" @click="beihuodetail()">
				<view class="flexleft">
					<image src="../../static/image/system/bei.png" mode="" style="width: 50rpx;height: 50rpx;"></image>
					<view class="huang_text main_size bold margin_left1">查看製作詳情</view>
				</view>
				<u-icon name="arrow-right" color="#FF8505" size="12"></u-icon>
			</view>
			<view class="flexcenter margin_top" v-show="tabsId==3">
				<view class="all1" :class="lable===''?'checkall':''" @click="changelable('')">全部</view>
				<view class="all4" :class="lable==2?'checkall':''" @click="changelable(2)">内用</view>
				<view class="all2" :class="lable==1?'checkall':''" @click="changelable(1)">自取</view>
				<view class="all3" :class="lable===0?'checkall':''" @click="changelable(0)">外送</view>
			</view>
			<view class="flexcenter margin_top" v-show="tabsId==4">
				<view class="all1" :class="status=='6'?'checkall':''" @click="changestatus('6')">待接單</view>
				<view class="all3" :class="status=='7,8'?'checkall':''" @click="changestatus('7,8')">配送中</view>
			</view>
			<view class="flexcenter" v-if="!list.data.length">
				<view class="placeholderimage" style="margin-top: 100rpx;"></view>
			</view>
			<view class="mainpadding_top ffffff radius" v-for="item in list.data" :key="item.id"
				@click="jumpdetai(item.id)">
				<view class="flexbetween">
					<view class="flexleft">
						<view class="margin_right lableradius waisong" v-if="item.type==0">外送</view>
						<view class="margin_right lableradius ziqu" v-if="item.type==1">自取</view>
						<view class="margin_right lableradius neiyong" v-if="item.type==2">内用</view>
						<view class="margin_right hong_text titletext bold">#{{item.call_no}}</view>
						<view class="hong_text titletext bold" v-if="item.type==2&&item.desk && item.desk!=-1">
							{{item.desk}}
						</view>
					</view>
					<view class="hong_text main_size" v-show="item.status==0">待支付</view>
					<view class="hong_text main_size" v-show="item.status==1">待接單</view>
					<view class="hong_text main_size" v-show="item.status==2">製作中</view>
					<view class="hong_text main_size" v-show="item.status==5">待出貨</view>
					<!-- <view class="hong_text main_size" v-show="item.status==3">待出货</view> -->
					<view class="huang_text main_size" v-show="item.status==6">待接單</view>
					<view class="huang_text main_size" v-show="item.status==8&&item.ps_type==0">物流配送</view>
					<view class="huang_text main_size" v-show="item.status==8&&(item.ps_type==1 || item.ps_type==2)">配送中
					</view>
					<view class="huang_text main_size" v-show="item.status==7&&item.ps_type==1">商家自送</view>
					<view class="huang_text main_size" v-show="item.status==7&&item.ps_type==2">騎手外送</view>
					<view class="huang_text main_size" v-show="item.status==9">已送达</view>
					<view class="huang_text main_size" v-show="item.status==87">待完成</view>
					<view class="lv_text main_size" v-show="item.status==88">已完成</view>
					<view class="hui_text main_size" v-show="item.status==97">已退款</view>
				</view>
				<view class="margin_top2 flexbetween xiaohui">
					<view class="yihang" style="width: 360rpx;">{{item.order_sn}}</view>
					<view>{{secondDate(item.createtime,0,0)}}</view>
				</view>
				<view class="margin_top2">
					<view class="xiaolan main_size" v-if="item.opentype==0">發票類型：紙本</view>
					<view class="xiaolan main_size" v-if="item.opentype==1">發票類型：載具</view>
					<view class="xiaolan main_size" v-if="item.opentype==2">發票類型：統編</view>
					<view class="xiaolan main_size" v-if="item.opentype==3">發票類型：捐贈</view>
				</view>
				<view class="margin_top2 xiaolan flexbetween" v-if="item.fpinfo">
					<view>發票編號：{{item.fpinfo.invoice_number}}</view>
					<view class="xiaohong" v-show="item.fpinfo.status==3">發票作廢成功</view>
					<!-- <view class="xiaolan" v-if="item.fpinfo.status==2" style="text-decoration: underline;color: #e56969;"  @click.stop="zuofei(item.fpinfo.id)" >作廢發票</view> -->
				</view>
				<view class="margin_top2 flexbetween xiaohui" v-if="item.type==2">
					<view>用餐時間：{{secondDate(item.draktime,0,0)}}</view>
					<view>合計{{Number(item.adult)+Number(item.old)+Number(item.child)}}人</view>
				</view>
				<view class="pdl" v-for="value in item.goods_data" :key="value.id">
					<view class="flexleft margin_top">
						<view class="listleftimg radius margin_right">
							<image class="listleftimg radius" :src="value.logoimage" mode=""></image>
							<!-- <view class="yizhizuo">已制作</view> -->
						</view>
						<view style="width: 100%;">
							<view class="hei_text main_size bold">{{value.goods_name}}</view>
							<view class="xiaohui flexbetween" v-if="value.wei || value.hei">
								<text>尺寸：{{value.wei}}*{{value.hei}}</text>
								<text>用量：{{value.formulacount}}{{value.size}}</text>
							</view>
							<view class="xiaohui" v-if="value.spunatname">規格：{{value.spunatname}}</view>
							<view class="flexbetween">
								<view class="main_size huang_text bold">
									${{Number(value.d_price).toFixed(0)}}&nbsp;&nbsp;&nbsp;x{{value.num}}</view>
								<view class="xiaohuang">${{Number(value.price).toFixed(0)}}</view>
							</view>
						</view>
					</view>
					<view class="flexright" v-show="item.status==5">
						<view class="listbtnhuang margin_top2" v-show="item.type==2&&value.is_sell==0"
							@click.stop="singleShipment(value,item)">出貨</view>
						<view class="listbtnhui margin_top2" v-show="item.type==2&&value.is_sell==1">已出貨</view>
					</view>
				</view>
				<view class="flexbetween margin_top" v-if="item.paypz_image">
					<view class="xiaohei main_size">支付憑證</view>
					<image class="listleftimg1 radius" :src="item.paypz_image_text" mode=""
						@click.stop="lbtpriview(0,[item.paypz_image_text])"></image>
				</view>
				<view class="xiaohui flexright margin_top bold" v-if="item.type==1">
					取：{{secondDate(item.askfortime,0,0)}}</view>
				<view class="xiaohui margin_top bold textright">
					共{{item.total_num || 0}}件，合計：
					<text class="xiaohuang">${{item.countmoney || 0}}</text>
					<text v-if="item.type==0">，運費${{item.freight_price || 0}}</text>
					<text>，優惠${{item.yh_money || 0}}，已付：${{item.paymoney || 0}}，</text>
					<text class="xiaohong">未付：${{item.zhuimoney || 0}}</text>
				</view>
				<view class="xiaohui margin_top bold textright">退款：${{item.tuiprice || 0}}</view>
				<view class="flexright margin_top flex_wrap">
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==1 && item.status!=0">點數支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==2">多元支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==3">現金支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==4">信用卡
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==5">Line Pay線上支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==6">街口線上支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==7">街口線下支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==8">Line Pay線下支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==9">Line Pay二維碼支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==10">街口二維碼支付
					</view>
					<view class="huang_text main_size bold margin_left2" v-show="item.paytype==11">全支付線下支付
					</view>
					<view class="listbtnhui margin_left2" @click.stop="phone(item.mobile)"
						v-show="item.status==0||item.status==1||item.status==7">聯係客戶</view>
					<view class="listbtnhuang margin_left2" @click.stop="xianjinwfsk(item)" v-show="item.status==0">確認收款
					</view>
					<view class="listbtnhuang margin_left2" v-show="item.status==1" @click.stop="suretakOrder(item)">
						確認接單</view>
					<view class="listbtnhui margin_left2" v-show="item.status==2" @click.stop="aginDyOrder(item.id)">
						收據列印
					</view>
					<view class="listbtnhuang margin_left2" v-show="item.status==88"
						@click.stop="tuikuanModal=true;currentid=item.id;currentAllprice=item.countmoney">退款
					</view>
					<view class="listbtnhui margin_left2" v-show="item.status==2||item.status==88"
						@click.stop="jumpdetai(item.id)">查看詳情
					</view>
					<view class="listbtnhuang margin_left2" v-show="item.type==2&&item.status==5"
						@click.stop="allShipment(item)">一次出貨
					</view>
					<view class="listbtnhuang margin_left2" v-show="item.type==1&&item.status==5"
						@click.stop="takeGoods(item.id)">通知提貨</view>
					<view class="listbtnhuang" @click.stop="wuliupsFn(item.id)" v-show="item.type==0&&item.status==5">
						物流配送
					</view>
					<view class="listbtnhuang margin_left2" @click.stop="phone(item.takeaway.phone)"
						v-show="(item.status==7&&item.ps_type==1)||(item.status==7&&item.ps_type==2)">聯係騎手</view>
					<view class="listbtnhuang margin_left2" @click.stop="chakanwlFn(item)"
						v-show="item.status==8&&item.ps_type==0">查看物流</view>
					<view class="listbtnhui margin_left2" v-show="item.type==0&&item.status==5"
						@click.stop="qsws(item.id)">騎手外送</view>
					<view class="listbtnhuang margin_left2" @click.stop="shopDeliver(item.id)"
						v-show="item.type==0&&item.status==5">商家自送</view>
					<view class="listbtnhuang margin_left2" v-show="item.status==87 && (Number(item.zhuimoney)!=0)"
						@click.stop="xianjinsk(item)">確認收款</view>
					<view class="listbtnhuang margin_left2" v-show="item.status==87 && item.zhuimoney==0"
						@click.stop="wanchengfw(item)">完成服務</view>
				</view>
			</view>
		</view>
		<!-- 物流配送 -->
		<u-modal :show="wlpsModal.show" title="物流配送" confirmColor="#FF8505" :closeOnClickOverlay="true" confirmText="確認"
			cancelText="取消" @close="wlpsModal.show=false" @confirm="wlpsconfirm">
			<view class="slot-content flexcenter mainpadding_top">
				<input type="text" placeholder="請輸入物流單號" style="text-align: center;" v-model="wlpsModal.text">
			</view>
		</u-modal>
		<u-modal :show="tuikuanModal" title="訂單退款" confirmColor="#FF8505" :closeOnClickOverlay="true" confirmText="確認"
			cancelText="取消" @close="tuikuanModal=false" @confirm="tuikuanconfirm">
			<view class="slot-content flexcolumn mainpadding_top">
				<view class="flexbetween">
					<view class="hei_text main_size">退款金額:</view>
					<input type="number" placeholder="請輸入退款金額" style="text-align: right;" v-model="tui_price">
				</view>
				<view class="flexbetween margin_top">
					<view class="hei_text main_size">退款密碼:</view>
					<input type="password" placeholder="請輸入退款密碼" v-model="paypassword" style="text-align: right;">
				</view>
			</view>
		</u-modal>

		<!-- 查看物流 -->
		<u-modal :show="ckwlModal.show" title="查看物流" confirmColor="#FF8505" confirmText="點擊複製"
			:closeOnClickOverlay="true" @close="ckwlModal.show=false" @confirm="copy(ckwlModal.text)">
			<view class="slot-content flexcenter mainpadding_top">{{ckwlModal.text}}</view>
		</u-modal>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				shop_id: uni.getStorageSync("shop_id"),
				list1: [{
					id: 0,
					name: '待支付',
					badge: {
						value: 0,
					}
				}, {
					id: 1,
					name: '待接單',
					badge: {
						value: 0,
					}
				}, {
					id: 2,
					name: '製作中',
					badge: {
						value: 0,
					}
				}, {
					id: 3,
					name: '待出貨',
					badge: {
						value: 0,
					}
				}, {
					id: 4,
					name: '配送中',
					badge: {
						value: 0,
					}
				}, {
					id: 5,
					name: '已完成',
					badge: {
						value: 0,
					}
				}, ],
				tabsId: 0, //默认待支付
				type: 0, //订單类型:0=外送,1=自取,2=内用
				status: 0, //订單状态:0 待支付1 已支付 2已接單  3 已出货/待取货 4已取货 5待出货 99已取消 88订單完成
				lable: '',
				wlpsModal: { //物流配送
					show: false,
					text: "",
				},
				ckwlModal: { //查看物流
					show: false,
					text: "",
				},
				page: 1,
				list: {
					data: []
				},
				id: "", //物流配送的订單id
				ztNum: 0,
				// 訂單退款
				tuikuanModal: false,
				currentid: "",
				currentAllprice: "",
				paypassword: "",
				tui_price: "",
				pos_show:false
			}
		},
		watch: {
			"wlpsModal.show"(newval) {
				if (!newval) {
					this.wlpsModal.text = ""
				}
			}
		},
		onShow() {
			console.log(Number(new Date()));
			this.getList()
			this.getztnum()
			this.getInfo()
		},
		methods: {
			getInfo(){
				this.http.request("/api/shop/Shopdeail", "POST", {
					shop_id: uni.getStorageSync("shop_id"),
				}).then(res=>{
					uni.setStorageSync("appkey", res.data.appkey)
					uni.setStorageSync("hy_type", res.data.hy_type)
					uni.setStorageSync("opentable_status", res.data.opentable_status)
					uni.setStorageSync("is_sdkfp", res.data.is_sdkfp)
					uni.setStorageSync("is_call_sdkfp", res.data.is_call_sdkfp)
					uni.setStorageSync("is_pos_sdkfp", res.data.is_pos_sdkfp)
					uni.setStorageSync("houtel_type",res.data.houtel_type)
					if(res.data.is_ny==0 && res.data.is_zq==0){
						this.pos_show = false
					}else{
						this.pos_show = true
					}
				})
			},
			
			getorderMsg() {
				this.http.request('/api/ordergoods/orderData', 'POST', {
					shop_id: this.shop_id, //店鋪id
				}).then(res => {
					this.list1[0].badge.value = res.data.dzf_num
					this.list1[1].badge.value = res.data.djd_num
					this.list1[2].badge.value = res.data.zzz_num
					this.list1[3].badge.value = res.data.dch_num
					this.list1[4].badge.value = res.data.psz_num
					this.list1[5].badge.value = res.data.ywc_num
				})
			},
			jumpurl(url) {
				uni.navigateTo({
					url
				})
			},
			getztnum() { //使用列表
				this.http.request('/api/shop/listtable', 'POST', {
					shop_id: this.shop_id, //店鋪id
				}).then(res => {
					if (res.code == 1) {
						this.ztNum = res.data.length
					} else {
						this.ztNum = 0
					}
				})
			},
			wanchengfw(item) {
				this.http.modal('', '是否確認完成服務', true, (res) => {
					if (res) {
						this.http.request('/api/ordergoods/neiendgoods', 'POST', {
							id: item.id,
						}).then(res => {
							if (res.code == 1) {
								this.http.toast("已完成服務")
								this.getList()
							} else {
								this.http.toast(res.msg)
							}
						})
					}
				})
			},
			xianjinsk(item) {
				if(item.order_type==1){
					this.http.modal('', '請確認是否完成確認收款', true, (res) => {
						if (res) {
							this.http.request('/api/ordergoods/endzhuimoney', 'POST', {
								id: item.id,
							}).then(res => {
								if (res.code == 1) {
									this.http.toast("確認收款完成")
									this.getList()
								} else {
									this.http.toast(res.msg)
								}
							})
						}
					})
				}else{
					uni.navigateTo({
						url:"/pages/yuYueOrder/yuyuesk?total_price="+item.zhuimoney+"&id="+item.ordermak_id
					})
				}
				
			},
			xianjinwfsk(item) {
				this.http.modal('', '請確認是否完成確認收款', true, (res) => {
					if (res) {
						this.http.request('/api/pay/quredypay', 'POST', {
							id: item.id,
						}).then(res => {
							if (res.code == 1) {
								this.http.toast("確認收款完成")
								this.getList()
							} else {
								this.http.toast(res.msg)
							}
						})
					}
				})
			},
			zuofei(id) {
				let data = {
					id
				}
				let url = '/api/shop/cancelShopFp'
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					httpRequest.toast(res.msg)
					if (res.code == 1) {
						this.getList()
					}
				})
			},
			phone(p) {
				uni.makePhoneCall({
					phoneNumber: p.toString()
				}).catch((e) => {
					console.log(e, "8988");
				})
			},
			getList(isPage, page) { //订單列表
				this.getorderMsg()
				let _this = this
				let data = {
					page: page || 1,
					limit: 12,
					status: this.status,
					shop_id: this.shop_id,
					type: this.status == 5 ? this.type.toString() : "",
					tab_type: this.tabsId == 5 ? 1 : 0
				}
				this.http.request('/api/Ordergoods/listOrdergoods', 'POST', data).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						resList.data.forEach(item => {
							let goods_allprice = 0
							item.goods_data.forEach(value => {
								value.logoimage = this.imgUrlUser + value.logoimage
								goods_allprice = Number(value.price) + Number(goods_allprice)
							})
							this.$set(item, "goods_allprice", goods_allprice)
						})
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							_this.list = res.data
							_this.list.data = resList.data;
						}
					} else if (res.code == 0) {
						this.list.data = []
						// this.http.toast(res.msg)
					} else {
						this.http.toast('系統處理中，請稍後再試');
					}
				})
			},
			onReachBottom() {
				console.log(this.page);
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.getList(true, page);
			},
			tabChage(e) {
				this.tabsId = e.id
				if (this.tabsId == 3) {
					this.type = ""
					this.lable = ""
				} else if (this.tabsId == 4) {
					this.type = ""
					this.lable = ''
					this.status = "6"
					this.getList()
					return false
					// this.type = 3
				} else {
					this.type = ""
				}
				let obj = {
					"0": 0, //待支付
					"1": 1, //待接單
					"2": 2, //已接單
					"3": 5, //待出货
					"4": 4, //配送中
					"5": "9,87,88,97", //已完成
				}
				this.status = obj[this.tabsId]
				console.log(obj[this.tabsId], "status");
				this.getList()
			},
			changelable(val) {
				this.lable = val
				this.type = this.lable
				this.getList()
			},
			changestatus(val) {
				this.status = val
				this.getList()
			},
			// 订單详情
			jumpdetai(id) {
				uni.navigateTo({
					url: "/pages/goodsOrder/dingdanxq?id=" + id
				})
			},
			// 重新打印小票
			async aginDyOrder(id) {
				uni.showLoading({
					mask: true,
					title: "請稍後"
				})
				let res = await this.http.request('/api/ordergoods/aginDyOrder', 'POST', {
					id
				})
				uni.hideLoading()
				if (res.code == 1) {
					httpRequest.toast("已發送指令")
				} else {
					httpRequest.toast(res.msg)
				}
			},
			// 確認接單
			async suretakOrder(item) {
				if (item.type == 2 && this.ztNum != 0 && Number(item.desk) <= 0) {
					let count = Number(item.adult) + Number(item.old) + Number(item.child)
					uni.navigateTo({
						url: `/pages/goodsOrder/xuanzezt?order_goods_id=${item.id}&count=${count}`
					})
					return false
				}
				let _this = this
				let res = await this.http.request('/api/Ordergoods/jieOrdergoods', 'POST', {
					id: item.id
				})
				if (res.code == 1) {
					this.http.toast("接單成功")
					this.getList()
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			// 制作详情
			beihuodetail() {
				uni.navigateTo({
					url: "/pages/goodsOrder/beihuoxq"
				})
			},
			async singleShipment(value, item) { //單個出货
				let res = await this.http.request('/api/Ordergoods/shellgoods_n', 'POST', {
					id: value.id,
					order_goods_id: item.id
				})
				if (res.code == 1) {
					this.http.toast("出貨成功")
					this.getList()
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			async allShipment(item) { //一次出货
				let res = await this.http.request('/api/Ordergoods/allgoods_n', 'POST', {
					id: item.id
				})
				if (res.code == 1) {
					this.http.toast("出貨成功")
					this.getList()
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			async takeGoods(id) { //確認提货
				let res = await this.http.request('/api/Ordergoods/endgoods', 'POST', {
					id
				})
				if (res.code == 1) {
					this.http.toast("提貨成功")
					this.getList()
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			wuliupsFn(id) { //物流配送
				this.id = id
				this.wlpsModal.show = true
			},
			async tuikuanconfirm() {
				if (this.tui_price == "") {
					this.http.toast("請輸入退款金額")
					return false
				}
				if (Number(this.currentAllprice) < Number(this.tui_price)) {
					this.http.toast("退款金額不能大於訂單合計金額")
					return false
				}
				if (this.paypassword == "") {
					this.http.toast("請輸入退款密碼")
					return false
				}
				this.tuikuanModal = false
				let res = await this.http.request('/api/Ordergoods/tuiOrderPrice', 'POST', {
					order_goods_id: this.currentid,
					paymoney: this.tui_price,
					paypassword: this.paypassword
				})
				this.currentid = ""
				this.tui_price = ""
				this.paypassword = ""
				this.http.toast(res.msg)
				if (res.code == 1) {
					this.getList()
				}
			},
			async wlpsconfirm() { //物流配送確認
				if (this.wlpsModal.text == "") {
					this.http.toast("請輸入物流單號")
					return false
				}
				let res = await this.http.request('/api/Ordergoods/wlendgoods', 'POST', {
					id: this.id,
					shopfreight_num: this.wlpsModal.text
				})
				if (res.code == 1) {
					this.http.toast("送貨成功")
					this.getList()
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
				this.wlpsModal.show = false
			},
			async qsws(id) { //骑手外送
				let res = await this.http.request('/api/Ordergoods/qsendgoods', 'POST', {
					id
				})
				if (res.code == 1) {
					this.http.toast("送貨成功")
					this.getList()
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			async shopDeliver(id) { //商家自送
				let res = await this.http.request('/api/Ordergoods/shopendgoods', 'POST', {
					id
				})
				if (res.code == 1) {
					this.http.toast("送貨成功")
					this.getList()
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			// 查看物流
			chakanwlFn(item) {
				this.ckwlModal.show = true
				this.ckwlModal.text = item.shopfreight_num
			},
			copy(value) {
				this.ckwlModal.show = false
				uni.setClipboardData({
					data: value.toString(), //要被复制的内容
					success: () => {
						//复制成功的回调函数
						this.http.toast("複製成功")
					}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.posdc {
		background: linear-gradient(180deg, #ff9c01 0%, #ffe070 100%);
		color: #333;
		border: 1rpx solid #333;
		font-size: 28rpx;
		padding: 10rpx 15rpx;
		border-radius: 50rpx;
		line-height: 28rpx;
	}

	.posdcimg {
		width: 220rpx;
		height: 60rpx;
	}

	.listleftimg1 {
		width: 150rpx;
		min-width: 150rpx;
		height: 150rpx;
		position: relative;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.zhizuotop {
		padding: 15rpx 30rpx;
		border: 1rpx solid #FF8505;
	}

	.all1 {
		background: #fFF;
		border-radius: 11rpx 0rpx 0rpx 11rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF8505;
		padding: 11rpx 38rpx;
		border: 2rpx solid #FF8505;
	}

	.all2 {
		background: #fFF;
		border-radius: 0rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF8505;
		padding: 11rpx 38rpx;
		border: 2rpx solid #FF8505;
		border-right: none;
		border-left: none;
	}

	.all4 {
		background: #fFF;
		border-radius: 0rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF8505;
		padding: 11rpx 38rpx;
		border: 2rpx solid #FF8505;
		border-left: none;
	}

	.all3 {
		background: #fFF;
		border-radius: 0rpx 11rpx 11rpx 0rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF8505;
		padding: 11rpx 38rpx;
		border: 2rpx solid #FF8505;
	}

	.checkall {
		background-color: #FF8505 !important;
		color: #fff !important;
	}
</style>